Featured
-
No Featured Found!
Tags
Convert HTML Content into Image to Show WebView in ObjectiveC iOS App
In our application sometimes there is a need to show webView content as a preview or as a thumbnail and for that simplest solution is to convert html content into image which can then easily be used in our app.
So ...
Convert Hexacode to UIColor in objective c
To convert the hexacode to color we can create a category of UIColor and implement the following code -
it will return the code corresponding to that hexacode
Hexa code can be in following format
1- #RGB
2 -#ARGB
3- #RRGGBB
4- #AARRGG...
Pusht to new ViewController with top to bottom animation
Hi,
Normally when we push to a ViewController it show the animation from left to right.
But we can change this to animation from to top to bottom.
here is the code to push a view controller from top to bottom.
- (void)pushFromTop:(U...
Saving secure data into keychain wrapper for app security
Hi Readers,
The keychain service provide a secure way to store content such as passwords, keys, certificates, etc. Each iOS app has a separate requirement to save items. There is a class named KeychainItemWrapper which provide you service to s...
How to make a view blur in iOS
If you want to make any UIView blur just like 'Notification' bar screen then here is a simple code to make it happen.
This method will return a blur view and you can add that to your view as a sub view.
-(UIVisualEffectView*)creat...
How to take screen shot of an iOS device
If you want to capture screen of an iOS device as you take the same from iPhone by pressing 'Power' button an 'Home' button then here is the code. It will take screen shot even if there is any transformation or transition running....
Javascript function call in webview
Hello Readers,
In order to call javascript functions within webview,following code snippet may be used:
Specify path of the html file which contains the javascript function:
NSString *path;
NSBundle *bundle = [NSBundle mainBundle];
p...
Make Paypal Payment in iOS
To Integrate paypal in iOS App use the steps below:
1- Install Pod for paypal
platform :ios, '6.0'
pod 'PayPal-iOS-SDK'
2- #import <PayPalMobile.h> to your viewController.h and also set the delegate in .h @interf...
Record a sound in iOS
To record the sound in ios we can use the code below:-
To record the sound first set the delegate of AVAudioRecorder in AudioRecorderViewController.h File like
#import "AudioRecorderViewController.h"
@interface AudioRecorderViewControl...
Blend Image in IOS
if you want add the custom frame on image like a border then
1- Add the GPU image Third party library to your project .
2- Use the image with imagename that you want to use as border image of originanl Image.
3- Framed image will the out...
How to create Triangular imageview in objective C
Here is the code for creating the triangular uiimageview -
UIBezierPath *bzrPath = [UIBezierPath new];
[bzrPath moveToPoint:(CGPoint){0, self.imgView.frame.size.height}];
[bzrPath addLineToPoint:(CGPoint){80, 0}];
[bzrPath...
Fetch the poi from google in ios
To fetch the poi from google we can use the GOOGLE API to get the list of POI near user location.
1- For creating the Key you can get the refrence from Link : https://developers.google.com/maps/documentation/ios-sdk/get-api-key#overview
...
How to get time intervals in hours between start time and end time in objective C
If we want to get the time intervals between the start time and end time then use the following code-
it will return the array of hours according to the start time and end time.
+ (NSMutableArray *)getTimeIntervals:(NSString *)startTime a...
Change the Flash mode of camera in ios
To set the camera flash on or off in ios Use the code below:
-(void)setFlashMode:(AVCaptureFlashMode)flashMode forDevice:(AVCaptureDevice *)device
{
if ( device.hasFlash && [device isFlashModeSupported:flashMode] ) {
...
Image is Blurred after cropped from a view
if you are going to take a snapShot of a view in ios and resultant image is blurred please change your code to following.
CGRect rect = [ScreenShotView bounds];
UIGraphicsBeginImageContext(rect.size);
Please change thi...
Take the ScreenShot of View with Tabbar & NavigationBar
To Take the screen shot Of a view with navigation & tabbar You can use this code:
-(UIImage *)getImageWithNavigationBarInIOS
{
CALayer *layer = [[UIApplication sharedApplication] keyWindow].layer;
CGFloat scale = [UIScre...
Parsing JSON objects using Mantle framework in Objective C
Hi Readers,
Mantle is latest and reliable framework which we can use while parsing JSON objects coming from server end. We can do this by simply initialize a class of type MTLModel.
We can understand framework working with following example...
Fetching Latitude and Longitude On Basis Of Address
Hello Friends,
In order to fetch the latitude and longitude of a location based on its address,you may use the following code:
double latitude = 0;
double longitude = 0;
Use the google api along with your address
NSStr...
Array of dates between two dates
Hello Friends,
To create an array of dates between two dates you may use the following code:
1.Create an NSMutableArray
NSMutableArray *datesArray = [NSMutableArray new];
2.Set the date formatter according to your requi...
DIFFERENCE BETWEEN C , C++ AND OBJECTIVE-C
Below are some important difference between C , C++ AND OBJECTIVE-C
C is a procedural language. C++ is procedural as well as object oriented programming language. Objective-C is a general-purpose, high-level, object-oriented programming lan...
Set the maximum date in UIDatePicker to Today
To set the maximum date of date picker in ios to today.
for example , if we want to pick the date of birth of a user then the date is can not be greater then today date .
So we can use following step to set the maximum date of datePicker
...
Unwind segue in iOS
To Use Unwind Segues in iOS.
1- Create three controller using storyBoard
2- Push from FirstViewControleller to SecondViewController
3- Push From SecondViewController to Third
Write a function in FirstViewController like this
-(IBAction...
Crop Image in iOS
To crop image in iOS use the following method.
it will crop the image from the visible frame of the imageView.
-(UIImage *)imageFromImageView:(UIImageView *)imageView rectFrame:(CGRect)frame{
UIGraphicsBeginImageContextWithOptions(frame....